/**
 * The Toolbar user-interface component class
 * @class syslib.ui.Toolbar
 * @author Gabriel Ricci
 */
syslib.ui.Toolbar = __class(syslib.ui.VisualTag, 
/**
 * @lends syslib.ui.Toolbar
 */
{
	// some class attributes
	id : "",

	prepare : function(){
		// set the id
		this.id = (__valid(this.__attributes.id)) ? this.__attributes.id : "panel_"  + Math.floor(Math.random() * 101);
		
		// load the style
		syslib.loadStyleForComponent("toolbar");
		
		// return
		return true;
	},

	execute : function(element){
		// set the attributes of the element
		var attributes	= syslib.object.extend(this.__attributes, { 
			"class" : "toolbar-container", 
			"width" : "100%"
		});
		
		// create the json structure
		elemtJSON = ["table", attributes,  
		["tbody", 
				["tr", 
					["td", {"valign" : "center", "class" : "toolbar-cell"}, 
						this.__innerHTML 
					] 
				] 
			] 
		];

		// create the element
		var toolbar = this.createDOM(elemtJSON);
		
		// return
		return toolbar;
	},

	finalize: function(){
		// return
		return true;
	}
});